//
//  TestFinishedModel.swift
//  Auscultation
//
//  Created by 张文博 on 2021/4/15.
//

import Foundation
import HandyJSON

struct TestFinishedModel:HandyJSON {
    var examBeginTime = ""
    var examEndTime = ""
    var passScore = 100
    var remark = 0
    var score = 0
    var totalScore = 100
    var examBeginTimeString: String{
        return String.lgf_TimeStampSwitchTimeStr(timeStamp: examBeginTime, format: "YYYY-MM-dd HH:mm:ss")
    }
    
    var examEndTimeString: String{
        return String.lgf_TimeStampSwitchTimeStr(timeStamp: examEndTime, format: "YYYY-MM-dd HH:mm:ss")
    }
    
    var testTimeString:String{
        let time = (examEndTime.int ?? 0) - (examBeginTime.int ?? 0)
        let secondInt = time / 1000
        return secondsToFormat(seconds: secondInt)

    }
    

    var pass :Bool{
        return score >= passScore
    }
    

}
